﻿using System.Web.Http;
using Weapp.Data;
using Weapp.Web.Models;

namespace Weapp.Web.Controllers
{
    public class BaseApiController : ApiController
    {
        private readonly IWeappRepository _repo;
        public BaseApiController(IWeappRepository repo)
        {
            _repo = repo;
        }

        public IWeappRepository TheRepository
        {
            get
            {
                return _repo;
            }
        }

        private ModelFactory _modelFactory;

        protected ModelFactory TheModelFactory
        {
            get { return _modelFactory ?? (_modelFactory = new ModelFactory(Request)); }
        }
    }
}